package com.ly.web.controller.erp;

import com.ly.common.annotation.Log;
import com.ly.common.core.domain.AjaxResult;
import com.ly.common.enums.BusinessType;
import com.ly.heart.domain.SysDeptPropertyEntity;
import com.ly.heart.service.ISysDeptPropertyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 部门属性表 前端控制器
 * </p>
 * @author WuZH
 * @since 2024-09-21
 */
@Api (value = "部门属性", tags = "部门属性")
@RestController
@RequestMapping ("/heart/sysDeptProperty")
public class SysDeptPropertyController {

    @Resource
    private ISysDeptPropertyService iSysDeptPropertyService;

    @GetMapping ("list")
    public AjaxResult list (SysDeptPropertyEntity sysDeptPropertyEntity) {
        AjaxResult ajaxResult = iSysDeptPropertyService.queryList ( sysDeptPropertyEntity );
        return ajaxResult;
    }

    @PostMapping
    public AjaxResult saveSingle (@RequestBody SysDeptPropertyEntity sysDeptPropertyEntity) {
        AjaxResult ajaxResult = iSysDeptPropertyService.saveSingle ( sysDeptPropertyEntity );
        return ajaxResult;
    }

    @PutMapping
    public AjaxResult updateSingle (@RequestBody SysDeptPropertyEntity sysDeptPropertyEntity) {
        AjaxResult ajaxResult = iSysDeptPropertyService.updateSingle ( sysDeptPropertyEntity );
        return ajaxResult;
    }

    @Log (title = "部门属性", businessType = BusinessType.DELETE)
    @DeleteMapping ("/{ids}")
    @ApiOperation ("删除部门属性")
    public AjaxResult deleteBatch (@PathVariable String[] ids) {
        AjaxResult ajaxResult = iSysDeptPropertyService.deleteBatch ( ids );
        return ajaxResult;
    }

}
